﻿<UserControl x:Class="MailboxPermissionsManager.Views.DelegatesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="150" d:DesignWidth="251">

    <DockPanel>
        <TextBlock Text="Delegates" TextDecorations="Underline" DockPanel.Dock="Top" FontSize="14" FontWeight="Bold"/>
        <DockPanel DockPanel.Dock="Top">
            <Button DockPanel.Dock="Right" Content="Change" Command="{Binding ChangeSchedulerDeliveryCommand}"/>
            <ComboBox ItemsSource="{Binding SchedulerOptions}" SelectedItem="{Binding SchedulerOption}"/>
        </DockPanel>
        <DockPanel DockPanel.Dock="Top">
            <Button DockPanel.Dock="Right" Content="Add" Padding="10,1" Command="{Binding AddDelegateCommand}"/>
            <CheckBox DockPanel.Dock="Right" VerticalAlignment="Center" IsChecked="{Binding NewDelegateViewPrivateItems}" ToolTip="View Private Items"/>
            <CheckBox DockPanel.Dock="Right" VerticalAlignment="Center" IsChecked="{Binding NewDelegateReceivesSchedulers}" ToolTip="Receive Schedulers"/>
            <ComboBox ItemsSource="{Binding Path=NewDelegatesView}" SelectedItem="{Binding MailboxToAddAsDelegate}"/>
        </DockPanel>
        <ListView ItemsSource="{Binding DelegateUsers}" HorizontalContentAlignment="Stretch">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <DockPanel>
                        <Button Content="Remove" DockPanel.Dock="Right" Command="{Binding RemoveDelegateCommand}"/>
                        <CheckBox IsChecked="{Binding ViewPrivate}" DockPanel.Dock="Right" VerticalAlignment="Center"/>
                        <Label Content="Private Items:" DockPanel.Dock="Right"/>
                        <CheckBox IsChecked="{Binding ReceiveSchedulers}" DockPanel.Dock="Right" VerticalAlignment="Center"/>
                        <Label Content="Schedulers:" DockPanel.Dock="Right"/>
                        <Label Content="{Binding Path=EwsDelegateUser.UserId.DisplayName, Mode=OneWay}" DockPanel.Dock="Left"/>
                    </DockPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </DockPanel>
</UserControl>
